package com.ysstech.etfmanage.feign.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 估值行情信息表
 * </p>
 *
 * @author lishuangliang
 * @since 2021-02-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("val_quotation")
public class Quotation extends Model<Quotation> {

    private static final long serialVersionUID = 1L;

    @TableField("ID")
    private String id;
    /**
     * 业务日期
     */
    //@JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @TableField("FDATE")
    private LocalDate fdate;
    /**
     * 证券代码
     */
    @TableField("SECURITY_CODE")
    private String securityCode;
    /**
     * 市场
     */
    @TableField("MARKET")
    private String market;
    /**
     * 行情收市价
     */
    @TableField("QUOTATION_CLOSING_PRICE")
    private BigDecimal quotationClosingPrice;
    /**
     * 行情平均价
     */
    @TableField("QUOTATION_AVERAGE_PRICE")
    private BigDecimal quotationAveragePrice;
    /**
     * 昨日收盘价
     */
    @TableField("YESTERDAY_CLOSING_PRICE")
    private BigDecimal yesterdayClosingPrice;
    /**
     * 今日开盘价
     */
    @TableField("TODAY_OPENING_PRICE")
    private BigDecimal todayOpeningPrice;
    /**
     * 最高成交价
     */
    @TableField("HIGHEST_TRANSACTION_PRICE")
    private BigDecimal highestTransactionPrice;
    /**
     * 最低成交价
     */
    @TableField("MINIMUM_TRANSACTION_PRICE")
    private BigDecimal minimumTransactionPrice;
    /**
     * 成交数量
     */
    @TableField("DEAL_AMOUNT")
    private BigDecimal dealAmount;
    /**
     * 成交金额
     */
    @TableField("DEAL_MONEY")
    private BigDecimal dealMoney;
    /**
     * 涨跌幅
     */
    @TableField("RISE_FALL_SCALE")
    private BigDecimal riseFallScale;
    /**
     * 证券类型
     */
    @TableField("SECURITY_TYPE")
    private String securityType;
    /**
     * 基金编码
     */
    @TableField("ACCOUNT_ID")
    private String accountId;
    /**
     * 剩余天数
     */
    @TableField("REMAINING_DAYS")
    private BigDecimal remainingDays;
    /**
     * 交易状态
     */
    @TableField("TRANSACTION_STATUS")
    private String transactionStatus;
    /**
     * 证券名称
     */
    @TableField("SECURITY_NAME")
    private String securityName;
    /**
     * 来源标志
     */
    @TableField("SOURCE_TYPE")
    private String sourceType;
    /**
     * 行情来源标志
     */
    @TableField("QUOTATION_SOURCE_TYPE")
    private String quotationSourceType;
    /**
     * 修正久期
     */
    @TableField("CORRECTION_DURATION")
    private BigDecimal correctionDuration;

    /**
     * 状态
     */
    @TableField("STATUS")
    private Integer status;
    /**
     * 添加时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField("ADD_TIME")
    private LocalDateTime addTime;

    /**
     * 添加用户
     */
    @TableField("ADD_USER")
    private String addUser;

    /**
     * 修改时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField("EDIT_TIME")
    private LocalDateTime editTime;

    /**
     * 修改用户
     */
    @TableField("EDIT_USER")
    private String editUser;
    /**
     * 删除原因
     */
    @TableField("DELETE_REASON")
    private String deleteReason;

    @Override
    protected Serializable pkVal() {
        return null;
    }

}
